package com.dk.springmvc.ajax.controller;

import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {

    @GetMapping("/axiosGet")
    public String axiosGet() {
        return "success";
    }

    @GetMapping("/axiosGetParam")
    public String axiosGetParam(String username, String password) {
        return "success,result=" + username + "," + password;
    }

    @PostMapping("/axiosPostParam")
    public String axiosPostParam(@RequestBody String json) {
        return "success,result=" + json;
    }

    @PutMapping("/axiosPutParam")
    public String axiosPutParam(@RequestBody String json){
        return "put success,result=" + json;
    }

    @DeleteMapping("/axiosDeleteParam")
    public String axiosDeleteParam(Integer id){
        return "delete success,result=" + id;
    }
}
